// import './App.css';
import React, { Component } from 'react'
import { Route, Link, NavLink } from "react-router-dom"
import About from './components/About'
import Home from './components/Home'
import MyNavLink from './components/MyNavLink'
export default class App extends Component {

  render() {
    return (
      <div className="App">
        <div>
          <div className="row">
            <div className="col-xs-offset-2 col-xs-8">
              <div className="page-header"><h2>React Router Demo</h2></div>
            </div>
          </div>
          <div className="row">
            <div className="col-xs-2 col-xs-offset-2">
              <div className="list-group">
                {/* 添加二级路由之后，页面加载之后再刷新可能会导致页面样式丢失问题，
                是由于react加载boostrap样式文件时默认从public文件下加载，加载boostrap文件采用的是相对路径，
                而刷新之后加载boostrap文件前会加上前面一级路径名，导致无法加载样式
                解决方法：
                在public中的index.html文件中
                  1. <link rel="stylesheet" href="./css/bootstrap.css">  改为<link rel="stylesheet" href="/css/bootstrap.css">
                  2. <link rel="stylesheet" href="./css/bootstrap.css">  改为<link rel="stylesheet" href="%PUBLIC_URL%/css/bootstrap.css">
                  */}
                  
                <MyNavLink to="/dell/home" >Home</MyNavLink>
                <MyNavLink to="/dell/about">About</MyNavLink>
              </div>
            </div>
            <div className="col-xs-6">
              <div className="panel">
                <div className="panel-body">
                  <Route path="/dell/home" component={Home} />
                  <Route path="/dell/about" component={About} />
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    )
  }
}

